//
//  ByDocumentaryCellBottomView.m
//  caipiao_ios
//
//  Created by mc on 2018/8/17.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByDocumentaryCellBottomView.h"

@implementation ByDocumentaryCellBottomView

- (id)init{
    self = [super init];
    if (self) {
        
        
        
        
        UIButton *bettingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:bettingBtn];
        [bettingBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-20);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(66, 27));
        }];
        [bettingBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [bettingBtn setTitle:@"立即跟单" forState:UIControlStateNormal];
        bettingBtn.backgroundColor = BY_THEME_COLOR;
        bettingBtn.titleLabel.font = FONT(12);
        bettingBtn.layer.cornerRadius = 5;
        [bettingBtn addTarget:self action:@selector(betAction:) forControlEvents:UIControlEventTouchUpInside];
        
        
        UILabel *buyLabel = [[UILabel alloc] init];
        [self addSubview:buyLabel];
        [buyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(27);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        buyLabel.text = @"投";
        buyLabel.textColor = [UIColor grayColor];
        buyLabel.textAlignment = NSTextAlignmentCenter;
        buyLabel.font = FONT(14);
        

        UILabel *countLabel = [[UILabel alloc] init];
        [self addSubview:countLabel];
        [countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(buyLabel.mas_right).offset(5);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(45, 25));
        }];
        countLabel.text = @"1";
        countLabel.textColor = BY_TEXT_COLOR;
        countLabel.textAlignment = NSTextAlignmentCenter;
        countLabel.font = FONT(14);
        countLabel.layer.borderColor = BY_LINE_COLOR.CGColor;
        countLabel.layer.borderWidth = 1;
        self.countLabel = countLabel;
        
        UILabel *timesLabel = [[UILabel alloc] init];
        [self addSubview:timesLabel];
        [timesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(countLabel.mas_right).offset(5);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        timesLabel.text = @"倍";
        timesLabel.textColor = [UIColor grayColor];
        timesLabel.textAlignment = NSTextAlignmentCenter;
        timesLabel.font = FONT(14);
        
        
        UILabel *moneyLabel = [[UILabel alloc] init];
        [self addSubview:moneyLabel];
        [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(timesLabel.mas_right).offset(10);
            make.centerY.equalTo(self).offset(0);
            make.right.equalTo(bettingBtn.mas_left).offset(-10);
            make.height.mas_equalTo(@15);
        }];
        moneyLabel.font = FONT(12);
        moneyLabel.text = @"2元";
        moneyLabel.textColor = [UIColor colorWithHexString:@"#FA2167"];;
        moneyLabel.textAlignment = NSTextAlignmentCenter;
        self.moneyLabel = moneyLabel;
        
    }
    return self;
}


- (void)betAction:(UIButton *)btn{
    if (self.betBlock) {
        self.betBlock();
    }
    
}

@end
